/**
 * Project Name:Micro-Services-Common
 * File Name   :JdkLogger.java
 * Package Name:com.micro.services.common.logger.jdk
 * Date:2015年9月8日上午12:40:33
 * Copyright (c) 2015, http://my.oschina.net/httpssl All Rights Reserved.
 *
*/

package com.micro.services.common.logger.jdk;

import java.io.Serializable;
import java.util.logging.Level;

import com.micro.services.common.logger.Logger;


/**
 * ClassName:JdkLogger <br/>
 * Function :TODO ADD FUNCTION. <br/>
 * Reason	:TODO ADD REASON. <br/>
 * Date     :2015年9月8日 上午12:40:33 <br/>
 * @author  :http://my.oschina.net/httpssl
 * @email   :491835898@QQ.COM
 * @since   :JDK 1.7
 * @see 	 
 */
public class JdkLogger implements Logger,Serializable
{

	private static final long serialVersionUID = 1L;
	
	private java.util.logging.Logger logger;
	
	public JdkLogger(java.util.logging.Logger logger){
		this.logger = logger;
	}
	
	@Override
	public void trace(String msg) {
		// TODO Auto-generated method stub
		logger.log(Level.FINER, msg);
	}

	@Override
	public void trace(Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.FINER, e.getMessage(),e);
	}

	@Override
	public void trace(String msg, Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.FINER, msg, e);
	}

	@Override
	public void debug(String msg) {
		// TODO Auto-generated method stub
		logger.log(Level.FINE, msg);
	}

	@Override
	public void debug(Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.FINE, e.getMessage());
	}

	@Override
	public void debug(String msg, Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.FINE,msg,e);
	}

	@Override
	public void info(String msg) {
		// TODO Auto-generated method stub
		logger.info(msg);
	}

	@Override
	public void info(Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.INFO, e.getMessage(),e);
	}

	@Override
	public void info(String msg, Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.INFO, msg,e);
	}

	@Override
	public void warn(String msg) {
		// TODO Auto-generated method stub
		logger.log(Level.WARNING, msg);
	}

	@Override
	public void warn(Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.WARNING, e.getMessage());
	}

	@Override
	public void warn(String msg, Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.WARNING, msg,e);
	}

	@Override
	public void error(String msg) {
		// TODO Auto-generated method stub
		logger.log(Level.SEVERE, msg);
	}

	@Override
	public void error(Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.SEVERE, e.getMessage());
	}

	@Override
	public void error(String msg, Throwable e) {
		// TODO Auto-generated method stub
		logger.log(Level.SEVERE, msg,e);
	}

	@Override
	public boolean isTraceEnabled() {
		// TODO Auto-generated method stub
		return logger.isLoggable(Level.FINE);
	}

	@Override
	public boolean isDebugEnabled() {
		// TODO Auto-generated method stub
		return logger.isLoggable(Level.FINE);
	}

	@Override
	public boolean isInfoEnabled() {
		// TODO Auto-generated method stub
		return logger.isLoggable(Level.INFO);
	}

	@Override
	public boolean isWarnEnabled() {
		// TODO Auto-generated method stub
		return logger.isLoggable(Level.WARNING);
	}

	@Override
	public boolean isErrorEnabled() {
		// TODO Auto-generated method stub
		return logger.isLoggable(Level.SEVERE);
	}

}
